@extends('layouts.app')
@section('title', '财务管理')

@section('content')
    <div class="conn">
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    <table class="table table-hover">
                        <h2 class="text-center">客户申请</h2>
                        <thead>
                        <tr>
                            <th>姓名</th>
                            <th>申请金额</th>
                            <th>申请时间</th>
                            <th>还款批次</th>
                            <th>每月应还款</th>
                            <th>实际状态</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>


                        @foreach($list as $v)

                            <tr>
                                <td>{{$v->name}}</td>
                                <td>{{$v->money}}</td>
                                <td>{{$v->created_at}}</td>
                                <td>{{$v->limits}}</td>
                                <td>{{$v->repayment}}</td>
                                <td>
                                        {{$v->state_desc}}
                                </td>
                                <td>
                                    @if ($v->limits > $v->record()->latest()->value('frequency'))
                                        <a class=" btn btn-info btnn" data-id="{{ $v->id }}" style="float: left">状态更改</a>
                                    @endif
                                    <a  class=" btn btn-primary " href="{{ route('finance.show', $v->id) }}">还款记录</a>
                                </td>
                                {{--<td>--}}
                                    {{--@foreach(json_decode($v->img) as $file)--}}
                                        {{--<img src="{{ url($file) }}" width="50" height="50">--}}
                                    {{--@endforeach--}}
                                {{--</td>--}}
                                {{--<td>{{ $v->status_desc }}</td>--}}
                                {{--<td>
                                    <a class="update btn btn-info"  style="float: left" href="{{ route('examine.show', $v->id) }}">查看详情</a>
                                </td>--}}
                            </tr>
                        @endforeach

                        </tbody>

                    </table>
                </div>
            </div>
            <div class="row">
                <div class="col-md-12">
                    <div class="pull-right">
                        {{$list->render()}}
                    </div>
                </div>
            </div>
        </div>
    </div>
    <link rel="stylesheet" type="text/css"  href="{{ asset('css/finance/index.css') }}"/>
@endsection
@section('script')
    <script src="js/finance/customer.js" type="text/javascript" charset="utf-8"></script>
@endsection

